home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nebula 2
/
Nebula Two.iso
/
SourceCode
/
GameKit
/
Headers
/
gamekit
/
GameActor.h
< prev
next >
Wrap
Text File
|
1995-06-12
|
2KB
|
42 lines
/* Generated by Interface Builder */
// Abstract Class from which sprites may be derived.
// This basically provides basic variables to hold location and
// the necessary methods to access the location instance variables.
// For basic funtionality, -move: and -renderAt::move: need to be overridden
// -move: should set up px and py to tell the object which way to move
// and renderAt::move: should be able to draw a representation of the
// GameActor. Note that actual movement happens when -moveOneFrame is
// called; -renderAt::move: will call -moveOneFrame if move:YES is chosen.
#import <appkit/appkit.h>
@interface GameActor:Object
{
id gameView; // the parent gameView
int myX, myY; // where we're at
int lastx, lasty; // where we were last drawn
int px, py; // which way we're going (x-y velocities)
int padding1;
int scale; // big or original size characters?
int padding2, padding3;
}
- init; // initialize the new instance vars
- (int)xpos; // return our x-coord
- (int)ypos; // return our y-coord
- move:sender; // Move the actor one animation frame
- lastAt:(float *)xx :(float *)yy; // to find out where actor was last drawn
- at:(float *)xx :(float *)yy; // where is the actor now?
- moveOneFrame; // makes the animation advance one step. Call -move:
// first to set up params.
- renderAt:(int)posx :(int)posy move:(BOOL)moveOk; // draw pac
// you should lock focus on view that gets the Pac first.
- (int)scale;
- setScale:(int)newScale;
@end